package com.kapo.egroup.entity.base;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;
import org.springframework.data.annotation.Id;

import java.util.Date;

/**
 * @Title baseEntity
 * @Description TODO
 * @Author 86159
 * @Date 2022-11-15 20:55
 **/
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
public class BaseEntity {
    /*
     * ID
     */
    @TableId(value = "_id",type = IdType.AUTO)
    @Id
    private Long id;

    /*
     * 创建日期
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
//    @TableField(fill = FieldFill.INSERT)
    private Date createTime;

    /*
     * 更新日期
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
//    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;

    /*
     * 是否删除
     */
    @TableLogic
    @JsonIgnore
    private boolean deleted;
}
